package com.rsk.utils.algorithm;

import java.util.Random;

public class AlphabetAlgorithm {
	
    public static String createNextAlphabet(String string){
        char [] tempChar = string.toCharArray();
        for(int i =tempChar.length-1;i>=1;i--){
            if (tempChar[i]<'Z' ){
                tempChar[i]=(char)(tempChar[i]+1);
                break;
            }else {
                tempChar[i]='A';
                tempChar[i-1]=(char)(tempChar[i-1]+1);
                if (tempChar[i-1]<='Z'){
                    i=0;
                }
            }
        }
        return String.valueOf(tempChar);
    }
    
    public static String randomNumForThree(){
    	Random random = new Random();
    	float radomInt = random.nextInt(999);
    	return radomInt == 0 ? "000" : (radomInt<100 ? String.valueOf(radomInt/100).replace(".", "") : String.valueOf(radomInt).replace(".0", ""));
    }
    
    public static void main(String[] args) {
        String a="AZ";
      /*  for (int i=1;i<26*26*26+1;i++){
            System.out.print(a+" ");
            a=createNext(a);
            if (i%26==0){
                System.out.println();
            }
        }*/
        a=createNextAlphabet(a)+randomNumForThree();
        System.out.println(a);
        
        for (int i = 0; i < 100; i++) {
        	Random random = new Random();
        	float radomInt = random.nextInt(9999);
        	String num = radomInt == 0 ? "0000" : (radomInt<1000 ? String.valueOf(radomInt/1000).replace(".", "") : String.valueOf(radomInt).replace(".0", ""));
            System.out.println(num);
//            int [] arr = new int[3];
//            arr[0] = random.nextInt(10);
//            arr[1] = random.nextInt(10);
//            arr[2] = random.nextInt(10);
//            
//            System.out.println(""+arr[0]+arr[1]+arr[2]);
		}
    }
}
